package com.andy.note.boot.enums.doctor;

/**
 * 
 * 
 *
 * @author Andy<908119428@qq.com>
 * @version $Revision: 1.1 $ $Date: 2021年8月2日 上午10:02:50 $
 */
public enum DoctorBookingCharge {

    PHYSICIAN_CHARGE("住院医师", 10), 
    HOSPITAL_CHARGE("医师", 10), 
    ATTENDING_CHARGE("主治医师", 10), 
    DEPUTY_CHARGE("副主任医师", 20),
    DEPUTY_TCM_CHARGE("副主任中医师", 20), 
    CHIEF_CHARGE("主任医师", 30), 
    CHIEFA_CHARGE("主任", 30), 
    CHIEF_TCM_CHARGE("主任中医师", 30),
    EXPERTS_CHARGE("名专家", 500);

    public String title;
    public Integer charge;

    /**
     * 医生职称对应预约费用
     * @param title
     * @return
     */
    public static Integer getBookingCharge(String title) {
        for (DoctorBookingCharge dbc : DoctorBookingCharge.values()) {
            if(dbc.getTitle().equals(title)) {
                return dbc.getCharge();
            }
        }
        return 0;
    }
    
    /**
     * 费用对应医师职称
     * @param title
     * @return
     */
    public static String getBookingTtile(Integer charge) {
        for (DoctorBookingCharge dbc : DoctorBookingCharge.values()) {
            if(dbc.getCharge().equals(charge)) {
                return dbc.getTitle();
            }
        }
        return null;
    }
    /**
     * @param charge
     */
    private DoctorBookingCharge(Integer charge) {
        this.charge = charge;
    }

    /**
     * @param title
     */
    private DoctorBookingCharge(String title) {
        this.title = title;
    }

    /**
     * @param title
     * @param charge
     */
    private DoctorBookingCharge(String title, Integer charge) {
        this.title = title;
        this.charge = charge;
    }

    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @return the charge
     */
    public Integer getCharge() {
        return charge;
    }

    /**
     * @param charge the charge to set
     */
    public void setCharge(Integer charge) {
        this.charge = charge;
    }

}
